package com.net.oil.order.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.order.bean.ReserveDetailBean;
import com.net.oil.order.contract.ReserveDetailContract;
import com.net.oil.order.model.ReserveDetailModel;

/**
 * 作者：lch
 * 时间：2018/4/27 0027:下午 22:45
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class ReserveDetailPresenter extends BasePresenter<ReserveDetailContract.View> implements ReserveDetailContract.Presenter {

    private ReserveDetailContract.View view;
    private ReserveDetailContract.Model model;

    public ReserveDetailPresenter(ReserveDetailContract.View view) {
        this.view = view;
        model = new ReserveDetailModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getReserveDetail(int id) {
        model.getReserveDetail(id);
    }

    @Override
    public void getReserveDetailSuccess(ReserveDetailBean reserveDetailBean) {
        view.getReserveDetailSuccess(reserveDetailBean);
    }

    @Override
    public void getReserveDetailFailed() {
        view.getReserveDetailFailed();
    }

    @Override
    public void cancelReserve(int id) {
        model.cancelReserve(id);
    }

    @Override
    public void cancelReserveSuccess() {
        view.cancelReserveSuccess();
    }

    @Override
    public void cancelReserveFailed() {
        view.cancelReserveFailed();
    }
}
